<#include "license.ftl">
<@license/>
package ${doc.all.package}.gwt.constants;

import com.google.gwt.core.client.GWT;

/**
* Contains constants derived from the model files for:<br>
* - the model;<br>
* - the attributes;<br>
* - help tags;<br>
* - custom constant bundles.
* @author Redora (www.redora.net)
*/
public interface Constants extends com.google.gwt.i18n.client.Constants {
    public static final Constants INSTANCE = GWT.create(Constants.class);

<#list doc["/all/object"] as model>
    <#list model.caption as cap>
        <#if cap.@language == doc.all.languages.@defaultLanguage>
    @DefaultStringValue("${cap.@table}")
    @Key("${model.@name}.table")
    String ${model.@name?uncap_first}_table();

    @DefaultStringValue("${cap.@form}")
    @Key("${model.@name}.form")
    String ${model.@name?uncap_first}_form();
        </#if>
    </#list>

    <#list model["attributes/*[not(@parentClass)]"] as att>
        <#if att?node_type == "element">
            <#list att.caption as cap>
                <#if cap.@language == doc.all.languages.@defaultLanguage>
    @DefaultStringValue("${cap.@table}")
    @Key("${model.@name}.${att.@fieldName}.table")
    String ${model.@name?uncap_first}_${att.@fieldName}_table();

    @DefaultStringValue("${cap.@form}")
    @Key("${model.@name}.${att.@fieldName}.form")
    String ${model.@name?uncap_first}_${att.@fieldName}_form();
    	        </#if>
            </#list>
        </#if>
        <#if att?node_name == "enum" && att.@scope == "local">
            <#list att.element as value>
                <#list value.caption as cap>
                    <#if cap.@language == doc.all.languages.@defaultLanguage>
    @DefaultStringValue("${cap.@table}")
    @Key("${model.@name}.${att.@fieldName}.${value.@name}.table")
    String ${model.@name?uncap_first}_${att.@fieldName}_${value.@name}_table();

    @DefaultStringValue("${cap.@form}")
    @Key("${model.@name}.${att.@fieldName}.${value.@name}.form")
    String ${model.@name?uncap_first}_${att.@fieldName}_${value.@name}_form();
                    </#if>
                </#list>
            </#list>
        </#if>

        <#list att.help as help>
            <#if help.@language == doc.all.languages.@defaultLanguage>
    @DefaultStringValue("${help}")
    @Key("${model.@name}.${att.@name}.help")
    String ${model.@name?uncap_first}_${att.@name}_help();

            </#if>
        </#list>
    </#list>

    <#assign defaultConstant = "">
    <#list model.i18n.constantBundle as bundle>
        <#if bundle.@javadoc[0]??>/** ${bundle.@javadoc} */</#if>
        <#assign defaultConstant = "">
        <#list bundle.constant as constant>
            <#if constant.@language == "en">
                <#assign defaultConstant = constant?chop_linebreak?trim?j_string>
            </#if>
        </#list>
    @DefaultStringValue("${defaultConstant}")
    @Key("${model.@name}.${bundle.@name}")
    String ${model.@name?uncap_first}_${bundle.@name}();
    </#list>
</#list>
}
